const md5 = require('md5')
const SALT = 'salt'


const md5Password = (password) => {
    const md5PWD = md5(password + SALT)
    return md5PWD
}
const matchPassword = (oldMD5Pwd, newPwd) => {
    let newMD5Pwd = md5Password(newPwd)
    if (oldMD5Pwd === newMD5Pwd) {
        return true
    }
    return false
}
module.exports = { md5Password,matchPassword }
